/*
# MIAHX© 框架消息 FastDDS API 的 Nodejs Addon 测试脚本（Nodejs端）

Version: 0.4.10,
Last updated: October 17, 2024

## Contributor(s)
* YAO Naiming <[naiming@iscas.ac.cn](mailto:naiming@iscas.ac.cn)>

## Change log
### v0.4.10
- .17: [更新] 重命名
### v0.4.7
- .26: [新增] 初始实现

---
Copyright © 2024-2025 MIAHX Contributors, ISCAS, and ASIC. All Rights Reserved.
Licensed under Apache-2.0.
*/

const { MiahxWrapperNodejsAddon } = require("../build/Release/miahx_wrapper_nodejs");

function sleep(ms) {
    return new Promise(resolve => setTimeout(resolve, ms));
}

async function func(support) {
    await sleep(10000);
    support.destroy();
}

const wrapper = new MiahxWrapperNodejsAddon(
    function (msg) {
        console.log(msg);
    }
);

func(wrapper);
